﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package Transactions {

    public class TCollectDailyBonus extends TWorldState {

        private var m_isRecovery:Boolean;

        public function TCollectDailyBonus(_arg1:Boolean=false){
            super(null);
            this.m_isRecovery = _arg1;
        }
        override public function perform():void{
            if (this.m_isRecovery){
                signedCall("UserService.recoverDailyBonus");
            } else {
                signedCall("UserService.collectDailyBonus");
            };
        }
        override protected function onWorldActionComplete(_arg1:Object):void{
            if (_arg1 != null){
                if (_arg1.randomReward != null){
                    Global.player.dailyBonusManager.randomReward = _arg1.randomReward.toString();
                };
                if (Global.player.dailyBonusManager.isLastDay()){
                    Global.player.dailyBonusManager.doBonusEndTasks();
                };
            };
        }

    }
}//package Transactions 
